home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / QDOffscreen.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  6.9 KB  |  251 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        QDOffscreen.h
  3.  
  4.      Contains:    Quickdraw Offscreen GWorld Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1985-1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QDOFFSCREEN__
  18. #define __QDOFFSCREEN__
  19.  
  20. #ifndef __MACERRORS__
  21.     #include <MacErrors.h>
  22. #endif
  23.  
  24. #ifndef __QUICKDRAW__
  25.     #include <Quickdraw.h>
  26. #endif
  27.  
  28.  
  29.  
  30.  
  31. #if PRAGMA_ONCE
  32. #pragma once
  33. #endif
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39. #if PRAGMA_IMPORT
  40. #pragma import on
  41. #endif
  42.  
  43. #if PRAGMA_STRUCT_ALIGN
  44.     #pragma options align=mac68k
  45. #elif PRAGMA_STRUCT_PACKPUSH
  46.     #pragma pack(push, 2)
  47. #elif PRAGMA_STRUCT_PACK
  48.     #pragma pack(2)
  49. #endif
  50.  
  51. enum {
  52.     pixPurgeBit                    = 0,
  53.     noNewDeviceBit                = 1,
  54.     useTempMemBit                = 2,
  55.     keepLocalBit                = 3,
  56.     useDistantHdwrMemBit        = 4,
  57.     useLocalHdwrMemBit            = 5,
  58.     pixelsPurgeableBit            = 6,
  59.     pixelsLockedBit                = 7,
  60.     mapPixBit                    = 16,
  61.     newDepthBit                    = 17,
  62.     alignPixBit                    = 18,
  63.     newRowBytesBit                = 19,
  64.     reallocPixBit                = 20,
  65.     clipPixBit                    = 28,
  66.     stretchPixBit                = 29,
  67.     ditherPixBit                = 30,
  68.     gwFlagErrBit                = 31
  69. };
  70.  
  71. enum {
  72.     pixPurge                    = 1L << pixPurgeBit,
  73.     noNewDevice                    = 1L << noNewDeviceBit,
  74.     useTempMem                    = 1L << useTempMemBit,
  75.     keepLocal                    = 1L << keepLocalBit,
  76.     useDistantHdwrMem            = 1L << useDistantHdwrMemBit,
  77.     useLocalHdwrMem                = 1L << useLocalHdwrMemBit,
  78.     pixelsPurgeable                = 1L << pixelsPurgeableBit,
  79.     pixelsLocked                = 1L << pixelsLockedBit,
  80.     kAllocDirectDrawSurface        = 1L << 14,
  81.     mapPix                        = 1L << mapPixBit,
  82.     newDepth                    = 1L << newDepthBit,
  83.     alignPix                    = 1L << alignPixBit,
  84.     newRowBytes                    = 1L << newRowBytesBit,
  85.     reallocPix                    = 1L << reallocPixBit,
  86.     clipPix                        = 1L << clipPixBit,
  87.     stretchPix                    = 1L << stretchPixBit,
  88.     ditherPix                    = 1L << ditherPixBit,
  89.     gwFlagErr                    = 1L << gwFlagErrBit
  90. };
  91.  
  92. typedef unsigned long                     GWorldFlags;
  93. /* Type definition of a GWorldPtr */
  94. typedef CGrafPtr                         GWorldPtr;
  95. EXTERN_API( QDErr )
  96. NewGWorld                        (GWorldPtr *            offscreenGWorld,
  97.                                  short                     PixelDepth,
  98.                                  const Rect *            boundsRect,
  99.                                  CTabHandle             cTable, /* can be NULL */
  100.                                  GDHandle                 aGDevice, /* can be NULL */
  101.                                  GWorldFlags             flags)                                FOURWORDINLINE(0x203C, 0x0016, 0x0000, 0xAB1D);
  102.  
  103. /* GDevice attribute bits for Carbon and QuickTime 3.0*/
  104. enum {
  105.     deviceIsIndirect            = (1L << 0),
  106.     deviceNeedsLock                = (1L << 1),
  107.     deviceIsStatic                = (1L << 2),
  108.     deviceIsExternalBuffer        = (1L << 3),
  109.     deviceIsDDSurface            = (1L << 4),
  110.     deviceIsDCISurface            = (1L << 5),
  111.     deviceIsGDISurface            = (1L << 6),
  112.     deviceIsAScreen                = (1L << 7),
  113.     deviceIsOverlaySurface        = (1L << 8)
  114. };
  115.  
  116. #if TARGET_OS_WIN32
  117. EXTERN_API( void *)
  118. GetGDeviceSurface                (GDHandle                 gdh);
  119.  
  120. EXTERN_API( unsigned long )
  121. GetGDeviceAttributes            (GDHandle                 gdh);
  122.  
  123. /* to allocate non-mac-rgb GWorlds use QTNewGWorld (ImageCompression.h) */
  124. EXTERN_API( QDErr )
  125. NewGWorldFromHBITMAP            (GWorldPtr *            offscreenGWorld,
  126.                                  CTabHandle             cTable,
  127.                                  GDHandle                 aGDevice,
  128.                                  GWorldFlags             flags,
  129.                                  void *                    newHBITMAP,
  130.                                  void *                    newHDC);
  131.  
  132. #endif  /* TARGET_OS_WIN32 */
  133.  
  134. EXTERN_API( QDErr )
  135. NewGWorldFromPtr                (GWorldPtr *            offscreenGWorld,
  136.                                  unsigned long             PixelFormat,
  137.                                  const Rect *            boundsRect,
  138.                                  CTabHandle             cTable,
  139.                                  GDHandle                 aGDevice,
  140.                                  GWorldFlags             flags,
  141.                                  Ptr                     newBuffer,
  142.                                  long                     rowBytes);
  143.  
  144. EXTERN_API( Boolean )
  145. LockPixels                        (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x0001, 0xAB1D);
  146.  
  147. EXTERN_API( void )
  148. UnlockPixels                    (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x0002, 0xAB1D);
  149.  
  150. EXTERN_API( GWorldFlags )
  151. UpdateGWorld                    (GWorldPtr *            offscreenGWorld,
  152.                                  short                     pixelDepth,
  153.                                  const Rect *            boundsRect,
  154.                                  CTabHandle             cTable,
  155.                                  GDHandle                 aGDevice, /* can be NULL */
  156.                                  GWorldFlags             flags)                                FOURWORDINLINE(0x203C, 0x0016, 0x0003, 0xAB1D);
  157.  
  158. EXTERN_API( void )
  159. DisposeGWorld                    (GWorldPtr                 offscreenGWorld)                    FOURWORDINLINE(0x203C, 0x0004, 0x0004, 0xAB1D);
  160.  
  161. EXTERN_API( void )
  162. GetGWorld                        (CGrafPtr *                port,
  163.                                  GDHandle *                gdh)                                FOURWORDINLINE(0x203C, 0x0008, 0x0005, 0xAB1D);
  164.  
  165. EXTERN_API( void )
  166. SetGWorld                        (CGrafPtr                 port,
  167.                                  GDHandle                 gdh)                                FOURWORDINLINE(0x203C, 0x0008, 0x0006, 0xAB1D);
  168.  
  169. EXTERN_API( void )
  170. CTabChanged                        (CTabHandle             ctab)                                FOURWORDINLINE(0x203C, 0x0004, 0x0007, 0xAB1D);
  171.  
  172. EXTERN_API( void )
  173. PixPatChanged                    (PixPatHandle             ppat)                                FOURWORDINLINE(0x203C, 0x0004, 0x0008, 0xAB1D);
  174.  
  175. EXTERN_API( void )
  176. PortChanged                        (GrafPtr                 port)                                FOURWORDINLINE(0x203C, 0x0004, 0x0009, 0xAB1D);
  177.  
  178. EXTERN_API( void )
  179. GDeviceChanged                    (GDHandle                 gdh)                                FOURWORDINLINE(0x203C, 0x0004, 0x000A, 0xAB1D);
  180.  
  181. EXTERN_API( void )
  182. AllowPurgePixels                (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000B, 0xAB1D);
  183.  
  184. EXTERN_API( void )
  185. NoPurgePixels                    (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000C, 0xAB1D);
  186.  
  187. EXTERN_API( GWorldFlags )
  188. GetPixelsState                    (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000D, 0xAB1D);
  189.  
  190. EXTERN_API( void )
  191. SetPixelsState                    (PixMapHandle             pm,
  192.                                  GWorldFlags             state)                                FOURWORDINLINE(0x203C, 0x0008, 0x000E, 0xAB1D);
  193.  
  194. EXTERN_API( Ptr )
  195. GetPixBaseAddr                    (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000F, 0xAB1D);
  196.  
  197. EXTERN_API( long )
  198. GetPixRowBytes                    (PixMapHandle             pm)                                    FOURWORDINLINE(0x203C, 0x0004, 0x0018, 0xAB1D);
  199.  
  200. EXTERN_API( QDErr )
  201. NewScreenBuffer                    (const Rect *            globalRect,
  202.                                  Boolean                 purgeable,
  203.                                  GDHandle *                gdh,
  204.                                  PixMapHandle *            offscreenPixMap)                    FOURWORDINLINE(0x203C, 0x000E, 0x0010, 0xAB1D);
  205.  
  206. EXTERN_API( void )
  207. DisposeScreenBuffer                (PixMapHandle             offscreenPixMap)                    FOURWORDINLINE(0x203C, 0x0004, 0x0011, 0xAB1D);
  208.  
  209. EXTERN_API( GDHandle )
  210. GetGWorldDevice                    (GWorldPtr                 offscreenGWorld)                    FOURWORDINLINE(0x203C, 0x0004, 0x0012, 0xAB1D);
  211.  
  212. EXTERN_API( Boolean )
  213. QDDone                            (GrafPtr                 port)                                FOURWORDINLINE(0x203C, 0x0004, 0x0013, 0xAB1D);
  214.  
  215. EXTERN_API( long )
  216. OffscreenVersion                (void)                                                        TWOWORDINLINE(0x7014, 0xAB1D);
  217.  
  218. EXTERN_API( QDErr )
  219. NewTempScreenBuffer                (const Rect *            globalRect,
  220.                                  Boolean                 purgeable,
  221.                                  GDHandle *                gdh,
  222.                                  PixMapHandle *            offscreenPixMap)                    FOURWORDINLINE(0x203C, 0x000E, 0x0015, 0xAB1D);
  223.  
  224. EXTERN_API( Boolean )
  225. PixMap32Bit                        (PixMapHandle             pmHandle)                            FOURWORDINLINE(0x203C, 0x0004, 0x0016, 0xAB1D);
  226.  
  227. EXTERN_API( PixMapHandle )
  228. GetGWorldPixMap                    (GWorldPtr                 offscreenGWorld)                    FOURWORDINLINE(0x203C, 0x0004, 0x0017, 0xAB1D);
  229.  
  230.  
  231. #if PRAGMA_STRUCT_ALIGN
  232.     #pragma options align=reset
  233. #elif PRAGMA_STRUCT_PACKPUSH
  234.     #pragma pack(pop)
  235. #elif PRAGMA_STRUCT_PACK
  236.     #pragma pack()
  237. #endif
  238.  
  239. #ifdef PRAGMA_IMPORT_OFF
  240. #pragma import off
  241. #elif PRAGMA_IMPORT
  242. #pragma import reset
  243. #endif
  244.  
  245. #ifdef __cplusplus
  246. }
  247. #endif
  248.  
  249. #endif /* __QDOFFSCREEN__ */
  250.  
  251.